<?php
/*添加数据*/
	error_reporting(0);
	$left = trim($_POST['left']);
	$right = trim($_POST['right']);

	$token = trim($_POST['token']);
	$tid = trim($_POST['tid']);
	$tName = trim($_POST['tName']);
	if(!$tid || !$tName || $tid == 'all'){
		exit('err5');
	}
	if(!$left || !$right){
		exit('err4');	//exit('输入格式为：a--->aaa');
	}
	require '../autoload.php';

	//token 验证
	if(!token_v('infoAdd',$token)){
		exit('err3');
	}
	$mp = new MyPdo();
	$sql = "select id from translate_info where typeid = ? and lefts = ?";
	$arr = array($tid,$left);
	$res = $mp->dql($sql,$arr,1);
	if($res){
		exit('err2');
	}else{
		$sql = "insert into translate_info values(null,?,?,?)";
		$arr = array($left,$right,$tid);
		$res = $mp->dml($sql,$arr);
		if($res){
			Clear_InfoAll();	//清除全部信息缓存		
			echo 'ok';		
		}else{
			echo 'err';
		}
	}


